﻿<storeApps:FlyoutView
    x:Class="GoG.WinRT.Views.CustomSettingsFlyout"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:GoG.WinRT.Views"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:storeApps="using:Microsoft.Practices.Prism.StoreApps"
    xmlns:viewModels="using:GoG.WinRT.ViewModels"
    d:DesignWidth="400"
    d:DataContext="{d:DesignInstance viewModels:CustomSettingsFlyoutViewModel}"
    storeApps:ViewModelLocator.AutoWireViewModel="True"
    mc:Ignorable="d">

    <Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition />
            <ColumnDefinition Width="20"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <TextBlock Text="Nova.GS Account"
                   FontSize="40"
                   Grid.ColumnSpan="2"
                   Margin="20"></TextBlock>

        <TextBlock Grid.Row="1" Grid.Column="0"
                   FontSize="18"
                   Margin="20,7,0,0"
                   Text="User Id:"
                   HorizontalAlignment="Right"
                   VerticalAlignment="Center"/>
        <TextBox Grid.Row="1" Grid.Column="1"
                 FontSize="18"
                 Margin="10,0,0,0"
                 Text="{Binding NovaGSUserId, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>

        <TextBlock Grid.Row="2" Grid.Column="0"
                   FontSize="18"
                   Margin="20,17,0,0"
                   Text="Password:"
                   HorizontalAlignment="Right"
                   VerticalAlignment="Center"/>
        <TextBox Grid.Row="2" Grid.Column="1"
                 FontSize="18"
                 Margin="10,10,0,5"
                 Text="{Binding NovaGSPassword, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>

        <TextBlock Text="{Binding BusyMessage}"
                   Grid.Row="3" Grid.Column="1"
                   Foreground="Yellow"
                   FontSize="14"
                   Margin="10,0,0,0"/>
        
        <Button Grid.Row="4" Grid.Column="1"
                Content="Save Credentials"
                Margin="10,5,0,0"
                HorizontalAlignment="Left"
                Command="{Binding AuthenticateNovaGSCredentialsCommand}"/>
        
        <HyperlinkButton Grid.Row="5"
                         Margin="0,10,0,0"
                         HorizontalContentAlignment="Left"
                         Grid.ColumnSpan="2" Grid.Column="0"
                         NavigateUri="http://nova.gs/">
            <TextBlock Text="Don't have a free Nova Go Server account?  Click here to register!"
                       TextWrapping="WrapWholeWords"/>
        </HyperlinkButton>
    </Grid>
</storeApps:FlyoutView>